package sardine.route;

import sardine.HttpMethod;

import java.util.Objects;

/**
 * @auth bruce_sha
 * @date 2015/5/21
 */
public class RouteMatched {

    final RouteEntry matchedRoute;
    final String requestURI;
    final String acceptType;

    public RouteMatched(RouteEntry matchedRouteEntry, String requestURI, String acceptType) {
        this.matchedRoute = Objects.requireNonNull(matchedRouteEntry);
        this.requestURI = Objects.requireNonNull(requestURI);
        this.acceptType = Objects.requireNonNull(acceptType);
    }

    public HttpMethod httpMethod() {
        return matchedRoute.httpMethod;
    }

    public Object target() {
        return matchedRoute.target;
    }

    public String routeURI() {
        return matchedRoute.path;
    }

    public String requestURI() {
        return requestURI;
    }

    public String acceptType() {
        return acceptType;
    }
}
